package com.android.demo;

import com.android.demo.widget.ResizeAnimation;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup.LayoutParams;
import android.view.Window;
import android.view.animation.ScaleAnimation;
import android.view.animation.TranslateAnimation;
import android.widget.Toast;

public class TestHeight extends Activity implements OnClickListener {
	View mParent;
	View mTop;
	View mBottom;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.test_height);
		
		mParent = findViewById(R.id.parent);
		mTop = findViewById(R.id.top);
		mBottom = findViewById(R.id.bottom);
		
		findViewById(R.id.visible_btn).setOnClickListener(this);
		findViewById(R.id.show_btn).setOnClickListener(this);
	}

	boolean expanded = true;
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.parent:
			break;
		case R.id.top:
			break;
		case R.id.bottom:
			break;
		case R.id.visible_btn:
//			int fx = mBottom.getWidth();
//			int tx = mBottom.getWidth();
//			int fy = expanded?mBottom.getHeight():0;
//			int ty = expanded?0:mBottom.getHeight();
			
			int fx = -1;
			int tx = -1;
			int fy = expanded?120:0;
			int ty = expanded?0:120;
			Log.i("ResizeAnimation", fx+","+ tx+","+ fy+","+ ty);
			
//			ResizeAnimation ra = new ResizeAnimation(mBottom, fx, tx, fy, ty);
//			ra.start(100);
			expanded=!expanded;
			
			break;
		case R.id.show_btn:
			Toast.makeText(this, "parent"+mParent.getHeight()+"top"+mTop.getHeight()+"bottom"+mBottom.getHeight(), 0).show();
			break;
		}
	}
}